<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<%=basePath%>res/css/right/style.css" rel="stylesheet"
	type="text/css" />

<title>专家分配</title>
<script type="text/javascript"
	src="<%=basePath%>/res/js/jquery-1.11.1.min.js"></script>
<style type="text/css">
.left {
	display: block;
	height: 35px;
	line-height: 35px;
	text-align: center;
}

.left:HOVER {
	background: #989898;
	color: #fff;
}
</style>
<script type="text/javascript">
	var applyBh;
	function validate() {
		if ($("#edit_search_key").val() == "") {
			alert("请输入要查找的产品名称");
			return false;
		}
		return true;
	}
	$(document).ready(function() {
		applyBh = getQueryString("applyBh");
	});
	function getQueryString(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = window.location.search.substr(1).match(reg);
		if (r != null)
			return unescape(r[2]);
		return null;
	}
	function addValidate() {
		if (applyBh == "undefined" || applyBh == null) {
			alert("请在左边选择项目");
			return false;
		} else {
			return true;
		}
	}
</script>
</head>

<body Link="black" Vlink="black">
<div style="background: #4c9ee7;width: 100%;height: 30px;margin-bottom: 5px">
	<label style="width: auto;height: 30px;text-align: center;color: white;line-height: 30px;margin-left: 5px">应用中心>>专家分配>>专家组列表</label>
	</div>
	<form id="form1" action="<%=basePath%>expert_assign/searchexpert"
		method="post">
		<div>
			<div class="" style="margin: 0 auto">
				<span><label style="font-size: medium;">请输入要查找的专家组名称:</label><input
					type="text" id="key" value="${key}" name="key"></span> <span><input
					type="submit" onclick="return validate()" class="btn_blue"
					value="搜索"> <a type="button" onclick="return addValidate()"
					href="<%=basePath %>/expert_assign/add?applyBh=${applyBh}"
					<c:if
						test="${(fn:length(expertPage.pageList) >= 2)}">
						style="display:none"
					</c:if>
					id="btnAdd" class="btn_blue">添加</a></span>
			</div>
		</div>
	</form>
	<div
		style="margin-top: 10px; position: absolute; float: left; width: 100%;">
		<div id="divLeft"
			style="width: 150px; height: auto; left: 0; top: 0px; position: absolute; background: #f5f5f5">
			<label
				style="height: 35px; width: 150px; background: #0090d7; line-height: 35px; text-align: center; vertical-align: middle; display: block; color: white;">认证产品</label>
			<c:forEach items="${left}" var="expert">
			<c:choose>
			<c:when test="${applyBh eq expert.applyBh.trim() }">
			<a style="text-decoration: none;background: #989898;color: #fff" class="left"
					href="<%=basePath%>expert_assign/list?applyBh=${expert.applyBh}">${expert.productName}</a>
			</c:when>
			<c:otherwise>
			<a style="text-decoration: none;" class="left"
					href="<%=basePath%>expert_assign/list?applyBh=${expert.applyBh}">${expert.productName}</a>
			</c:otherwise>
			</c:choose>
					<div style="width: 100%;height: 1px;background: #dcdcdc"></div>
					
			</c:forEach>
		</div>
		<div
			style="left: 160px; top: 0; float: right; position: absolute; width: 85%;">
			<table class="gvtable" border="0">
				<thead>
					<tr>
						<th width="10%">申请人</th>
						<th width="20%">申请时间</th>
						<th width="20%">专家组名称</th>
						<th width="20%">专家组层次</th>
						<th width="20%">备注</th>
						<th width="10%">数据操作</th>
					</tr>
				</thead>
				<tbody id="list">
					<script type="text/javascript">
						if (getQueryString("applyBh") == null) {
							var html = "<tr><td colspan=\"4\" style=\"margin: 5px\"><b>请在左边选择项目</b></td></tr>";
							$("#list").append(html);
						}
					</script>
					<c:if
						test="${((fn:length(expertPage.pageList) <= 0) || expertPage == null) && applyBh != null}">
						<tr>
							<td colspan="5" style="margin: 5px; width: 100%">暂无数据</td>
						</tr>
					</c:if>
					<c:forEach items="${expertPage.pageList}" var="expert">
						<tr>
						<td width="10%">${unityName} </td>
							<td width="20%">${aTime}</td>
							<c:choose>
								<c:when test="${expert.expertsClass == null }">
									<td width="20%">获取名字失败</td>
								</c:when>
								<c:otherwise>
									<td width="20%">${expert.expertsClass}</td>
								</c:otherwise>
							</c:choose>
							
							<td width="20%">${expert.expertsLevel}</td>
							<td width="20%">${expert.remark}</td>
							<td style="width: 10%;"><shiro:hasPermission
									name="EditExpertSet">
									<a
										href="<%=basePath%>expert_assign/edit?applyBh=${applyBh}&expertsNum=${expert.expertsNum}">编辑</a>
								</shiro:hasPermission> <shiro:hasPermission name="DeleteExpertSet">
									<a onclick="if(!confirm('确定删除')){return false;}"
										href="<%=basePath%>expert_assign/delete?expertsNum=${expert.expertsNum}&applyBh=${applyBh}">删除</a>
								</shiro:hasPermission>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
</body>

</html>
